<template>
  <div>
    <!-- 1.0 搜索框 & 添加用户按钮 -->
    <el-input class="search" placeholder="请输入要搜索的内容" @keyup.13.native="search" v-model="query">
      <el-button slot="append" icon="el-icon-search" ></el-button>
    </el-input>
    
  </div>
</template>
<script>
export default {
  props: {
    level: String
  },
  data() {
    return {
      query: '' //查询关键字
    }
  },
  methods: {
    //子组件给父组件传值
    add() {
      this.$emit('myadd')
    },
    search() {
      this.$emit('addSearch', this.query)
    }
  }
}
</script>